<%@page import="framework.core.DBConnection"%>
<%@page import="system.base.Product"%>
<%@page import="com.hitrust.gs.bean.GSWareHouseProductBean"%>
<%@page import="com.hitrust.gs.business.GSManufactureProcessor"%>
<%@ page contentType="text/html; charset=UTF-8"%>
<%
String dept=request.getParameter("dept");
String sid=request.getParameter("conid");
String[] temp=sid.split(",");
StringBuffer result=new StringBuffer();
GSManufactureProcessor mpro=new GSManufactureProcessor();
DBConnection con=DBConnection.open(true);
for(int i=0;i<temp.length;i++){
    if("NO".equals(temp[i])){
        result.append("NO");
    }else{
        System.out.print(temp[i]);
        Product product=Product.fetchByConcentricityCode(con,temp[i]);
        if(product==null){
            result.append("NO");
        }else{
            GSWareHouseProductBean tmp=mpro.getWareHouseProduct(dept,product.getId());
            if(tmp==null){
                result.append(product.getBalanceMode());
            }else{
                result.append(tmp.getBalance_mode());
            }
        }
    }
    if(i<temp.length-1){
        result.append("|");
    }
}
if(con!=null){
    con.close();
}
System.out.print(result.toString());
out.print(result.toString());
%>